using System.Collections.Generic;
using UnityEngine;

public class TournamentCareerDialogStage : MonoBehaviour
{
	public UILabel nameLabel;

	public UISprite flagSprite;

	public List<UISprite> stars = new List<UISprite>();

	public void Init(PlayerCareerStageDefinition.StageDefinition.SubStageDefinition subStage, PlayerCareer.StageProgress stageProgress, int index)
	{
		nameLabel.text = subStage.name;
		bool flag = index <= stageProgress.stage.playedGames;
		GameConstants.SetFlag(flagSprite, subStage.gameParams.opponent.player.flag);
		PlayerCareerDialog.SetStarCount(stars, stageProgress.GetSubStageProgress(index).playerScore);
		float alpha = ((!flag) ? 0.25f : 1f);
		if (index < stageProgress.stage.playedGames)
		{
			alpha = 0.5f;
		}
		GetComponent<UISprite>().alpha = alpha;
	}
}
